package com.orcamento.converter;

import java.util.Map;

import org.apache.struts2.util.StrutsTypeConverter;

import com.orcamento.util.Money;

public class MoneyConverter extends StrutsTypeConverter  {

	@SuppressWarnings("rawtypes")
	public Object convertFromString(Map context, String[] values, Class toClass) {
		return new Money( values[0] );
	}

	@SuppressWarnings("rawtypes")
	public String convertToString(Map context, Object o) {
		return ((Money) o).toString();
	}
	
}
